package com.hspedu.try_;

import java.util.Scanner;

public class StringBuffer02 {
    public static void main(String[] args) {
//        int count = 2;
        Scanner scanner = new Scanner(System.in);
        String price = scanner.next();
        StringBuffer sb = new StringBuffer(price);
        int index = sb.lastIndexOf(".");
        for (int i = index - 3; i > 0; i-=3) {
            sb = sb.insert(i , ",");
        }
        System.out.println(sb);
//        stringBuffer.insert(stringBuffer.length() - count,".");
//        count += 4;
//        int times = (price.length() - 2) /3;
//        for (int i = 0; i < imes; i++) {
//            stringBuffer.insert(stringBuffer.length() - count,",");
//            count += 4;
//        }
//        if((price.length() - 2) % 3 == 0){
//            stringBuffer.delete(0,1);
//        }
//        System.out.println(stringBuffer);

    }
}
